package com.litch.mvpdemo.view.activitys;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.litch.mvpdemo.R;
import com.litch.mvpdemo.presenter.PhoneByAddPre;
import com.litch.mvpdemo.presenter.impl.PhoneByAddPreImpl;
import com.litch.mvpdemo.view.PhoneByAddView;

/**
 * Created by Administrator on 2016/7/11.
 */
@AppActivity(layoutId = R.layout.activity_main)
public class MainActivity extends BaseActivity implements View.OnClickListener,PhoneByAddView{
    private EditText phoneInput;
    private Button okButton;
    private TextView resultView;
    private PhoneByAddPre phoneByAddPre;
    @InitView
    private void initView(){
        phoneInput = (EditText) findViewById(R.id.main_input);
        okButton = (Button) findViewById(R.id.main_okbtn);
        resultView = (TextView) findViewById(R.id.main_result);
        okButton.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.main_okbtn:
                String phone = phoneInput.getText().toString();
                phoneByAddPre = new PhoneByAddPreImpl(this);
                phoneByAddPre.getAdd(phone);
                break;
        }
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showResult(String result) {

    }
}
